﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QTableWidget>
#include <QDialog>
#include <QLineEdit>
#include <QComboBox>
#include <QMenu>
#include <QAction>

#pragma execution_character_set("utf-8")

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void Init();
    void Readstock();

private:
    void WriteFile();

    void SetTableWgtAligment();

    void CreateMenu();

protected slots:
    void onAddThings();
    void onAddClicked();

    void onTableContextMenuClicked();

    void onInputClicked();

    void oninputAddClicked();

    void onOutPutClicked();

    void onoutPutBtnClicked();

    void onDeleteClicked();

private:
    QPushButton *m_pInputBtn=nullptr;
    QPushButton *m_pOutPutBtn=nullptr;
    QPushButton *m_pAddThingBtn=nullptr;

    QMenu *m_pMenu = nullptr;

    QTableWidget *m_pTableWgt=nullptr;
    QStringList m_NameList;

    QDialog *m_pAddDialog=nullptr;
    QLineEdit *m_pAddNameEdit=nullptr;
    QLineEdit *m_pAddCountEdit=nullptr;

    QDialog *m_pInputDialog=nullptr;
    QComboBox *m_pInputComboBox=nullptr;
    QLineEdit *m_pInputCountEdit=nullptr;

    QDialog *m_poutputDialog=nullptr;
    QComboBox *m_poutputComboBox=nullptr;
    QLineEdit *m_poutputCountEdit=nullptr;
};
#endif // WIDGET_H
